export const tableConfig = [
    { prop: "name", label: "名称", minWidth: "140" },
    { prop: "code", label: "编码", minWidth: "140" },
    { prop: "value", label: "值", minWidth: "140" },
    { prop: "operateObject", label: "操作对象", minWidth: "140" },
    // { prop: "Phone", label: "排序", minWidth: "140" },
    { prop: "state", label: "有效", minWidth: "140", slotName: "state" },
    // { prop: "Phone", label: "公共", minWidth: "140" },
    { label: "操作", minWidth: "140", slotName: "operate", fixed: "right" }
];
export const rules = {
    code: [
        {
            validator: (rule, value, callback) => {
                if (!value) {
                    callback(new Error("请输入字典项编号"));
                } else {
                    return true;
                }
            },
            trigger: "blur"
        }
    ],

    name: [
        {
            validator: (rule, value, callback) => {
                if (!value) {
                    callback(new Error("请输入字典项名称"));
                } else {
                    return true;
                }
            },
            trigger: "blur"
        }
    ],
    value: [
        {
            validator: (rule, value, callback) => {
                if (!value) {
                    callback(new Error("请输入值"));
                } else {
                    return true;
                }
            },
            trigger: "blur"
        }
    ],
    parentCode: [
        {
            validator: (rule, value, callback) => {
                if (!value) {
                    callback(new Error("请选择上级"));
                } else {
                    return true;
                }
            },
            trigger: "change"
        }
    ]
};
